<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	
	<script>
		
		window.onload = function () {
			var num = 10;
			var box = document.getElementById('box');
			function run() {
				box.innerHTML = num;
				if(num==0){
					clearInterval(time);
				}
				num--;
			}

			time = setInterval(run,1000)
		}
	</script>

</head>
<body>
	<p id="box"></p>
</body>
</html>